package utils

import (
	"math/rand"
	"time"
)

var g_randins *rand.Rand

//生成区间为[start, end)
func GetRand(start int, end int) int {
	if g_randins == nil {
		g_randins = rand.New(rand.NewSource(time.Now().UnixNano()))
	}
	if (end - start) <= 0 {
		return start
	}
	return g_randins.Intn(end-start) + start
}
